package com.lovo.csc.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lovo.csc.bean.RefundBean;
import com.lovo.csc.mapper.IRefundMapper;
import com.lovo.csc.service.IRefundService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class RefundServiceImpl implements IRefundService {
    @Autowired
    private IRefundMapper refundMapper;

    @Override
    public void update(String msg, String idNum) {
        QueryWrapper<RefundBean> qw = new QueryWrapper<>();
        qw.eq("fk_userOrderIdNum", idNum);
        RefundBean refundBean = refundMapper.selectOne(qw);
        refundBean.setCause(msg);
        refundBean.setAuditState(2);
        refundMapper.updateById(refundBean);
        //远程调用后端接口修改退货订单的原因和状态

    }
}
